package com.gateway.repository.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 网关接口表
 * </p>
 *
 * @author auto_generation
 * @since 2025-02-04
 */
@TableName("gateway_api")
public class GatewayApi implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 接口编码
     */
    private String apiCode;

    /**
     * 接口名称
     */
    private String apiName;

    /**
     * 请求路径
     */
    private String apiPath;

    /**
     * 服务id
     */
    private String serviceId;

    /**
     * 全限定名
     */
    private String qualifiedName;

    /**
     * 方法名
     */
    private String methodName;

    /**
     * method类型
     */
    private String httpMethod;

    /**
     * 接口类型
     */
    private Integer apiType;

    /**
     * 读写类型
     */
    private Integer readOrWrite;

    /**
     * 接口描述
     */
    private String apiDesc;

    /**
     * 环境变量
     */
    private String env;

    /**
     * rpcType
     */
    private String rpcType;

    /**
     * module
     */
    private String module;

    /**
     * 是否认证
     */
    private Boolean authentication;

    /**
     * 是否认证
     */
    private Boolean authorization;


    /**
     * 认证类型
     */
    private String authenticationType;

    /**
     * 授权类型
     */
    private String authorizationType;

    /**
     * 是否需要csrf
     */
    private Boolean csrf;

    /**
     * 是否开放
     */
    private Boolean open;

    /**
     * 状态(0:下线，1:上线)
     */
    private Integer status;

    /**
     * 是否可变
     */
    private Integer changeable;

    /**
     * 备注
     */
    private String remark;

    /**
     * 行记录创建者
     */
    private String creator;

    /**
     * 行记录最近更新人
     */
    private String modifier;

    /**
     * 行记录创建时间
     */
    private Date createdTime;

    /**
     * 行记录最近修改时间
     */
    private Date modifiedTime;

    /**
     * 行版本号
     */
    @Version
    private Integer version;

    /**
     * 拓展字段
     */
    private String extension;

    /**
     * 是否删除
     */
    private Long deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getApiCode() {
        return apiCode;
    }

    public void setApiCode(String apiCode) {
        this.apiCode = apiCode;
    }

    public String getApiName() {
        return apiName;
    }

    public void setApiName(String apiName) {
        this.apiName = apiName;
    }

    public String getApiPath() {
        return apiPath;
    }

    public void setApiPath(String apiPath) {
        this.apiPath = apiPath;
    }

    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public String getQualifiedName() {
        return qualifiedName;
    }

    public void setQualifiedName(String qualifiedName) {
        this.qualifiedName = qualifiedName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getHttpMethod() {
        return httpMethod;
    }

    public void setHttpMethod(String httpMethod) {
        this.httpMethod = httpMethod;
    }

    public Integer getApiType() {
        return apiType;
    }

    public void setApiType(Integer apiType) {
        this.apiType = apiType;
    }

    public Integer getReadOrWrite() {
        return readOrWrite;
    }

    public void setReadOrWrite(Integer readOrWrite) {
        this.readOrWrite = readOrWrite;
    }

    public String getApiDesc() {
        return apiDesc;
    }

    public void setApiDesc(String apiDesc) {
        this.apiDesc = apiDesc;
    }

    public String getEnv() {
        return env;
    }

    public void setEnv(String env) {
        this.env = env;
    }

    public String getRpcType() {
        return rpcType;
    }

    public void setRpcType(String rpcType) {
        this.rpcType = rpcType;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Boolean getAuthentication() {
        return authentication;
    }

    public void setAuthentication(Boolean authentication) {
        this.authentication = authentication;
    }

    public Boolean getAuthorization() {
        return authorization;
    }

    public void setAuthorization(Boolean authorization) {
        this.authorization = authorization;
    }

    public String getAuthenticationType() {
        return authenticationType;
    }

    public void setAuthenticationType(String authenticationType) {
        this.authenticationType = authenticationType;
    }

    public String getAuthorizationType() {
        return authorizationType;
    }

    public void setAuthorizationType(String authorizationType) {
        this.authorizationType = authorizationType;
    }

    public Boolean getCsrf() {
        return csrf;
    }

    public void setCsrf(Boolean csrf) {
        this.csrf = csrf;
    }

    public Boolean getOpen() {
        return open;
    }

    public void setOpen(Boolean open) {
        this.open = open;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getChangeable() {
        return changeable;
    }

    public void setChangeable(Integer changeable) {
        this.changeable = changeable;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public Long getDeleted() {
        return deleted;
    }

    public void setDeleted(Long deleted) {
        this.deleted = deleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GatewayApi that = (GatewayApi) o;
        return Objects.equals(id, that.id) && Objects.equals(apiCode, that.apiCode) && Objects.equals(apiName, that.apiName) && Objects.equals(apiPath, that.apiPath) && Objects.equals(serviceId, that.serviceId) && Objects.equals(qualifiedName, that.qualifiedName) && Objects.equals(methodName, that.methodName) && Objects.equals(httpMethod, that.httpMethod) && Objects.equals(apiType, that.apiType) && Objects.equals(readOrWrite, that.readOrWrite) && Objects.equals(apiDesc, that.apiDesc) && Objects.equals(env, that.env) && Objects.equals(rpcType, that.rpcType) && Objects.equals(module, that.module) && Objects.equals(authentication, that.authentication) && Objects.equals(authorization, that.authorization) && Objects.equals(authenticationType, that.authenticationType) && Objects.equals(authorizationType, that.authorizationType) && Objects.equals(csrf, that.csrf) && Objects.equals(open, that.open) && Objects.equals(status, that.status) && Objects.equals(changeable, that.changeable) && Objects.equals(remark, that.remark) && Objects.equals(creator, that.creator) && Objects.equals(modifier, that.modifier) && Objects.equals(createdTime, that.createdTime) && Objects.equals(modifiedTime, that.modifiedTime) && Objects.equals(version, that.version) && Objects.equals(extension, that.extension) && Objects.equals(deleted, that.deleted);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, apiCode, apiName, apiPath, serviceId, qualifiedName, methodName, httpMethod, apiType, readOrWrite, apiDesc, env, rpcType, module, authentication, authorization, authenticationType, authorizationType, csrf, open, status, changeable, remark, creator, modifier, createdTime, modifiedTime, version, extension, deleted);
    }

    @Override
    public String toString() {
        return "GatewayApi{" +
                "id=" + id +
                ", apiCode='" + apiCode + '\'' +
                ", apiName='" + apiName + '\'' +
                ", apiPath='" + apiPath + '\'' +
                ", serviceId='" + serviceId + '\'' +
                ", qualifiedName='" + qualifiedName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", httpMethod='" + httpMethod + '\'' +
                ", apiType=" + apiType +
                ", readOrWrite=" + readOrWrite +
                ", apiDesc='" + apiDesc + '\'' +
                ", env='" + env + '\'' +
                ", rpcType='" + rpcType + '\'' +
                ", module='" + module + '\'' +
                ", authentication=" + authentication +
                ", authorization=" + authorization +
                ", authenticationType='" + authenticationType + '\'' +
                ", authorizationType='" + authorizationType + '\'' +
                ", csrf=" + csrf +
                ", open=" + open +
                ", status=" + status +
                ", changeable=" + changeable +
                ", remark='" + remark + '\'' +
                ", creator='" + creator + '\'' +
                ", modifier='" + modifier + '\'' +
                ", createdTime=" + createdTime +
                ", modifiedTime=" + modifiedTime +
                ", version=" + version +
                ", extension='" + extension + '\'' +
                ", deleted=" + deleted +
                '}';
    }
}
